import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

const path = require('path')
const resolve = (dir: string) => path.join(__dirname, dir)
import AutoImport from 'unplugin-auto-import/vite'
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        AutoImport({
            dts: 'src/auto-imports.d.ts', // 可以自定义文件生成的位置，默认是根目录下
            imports: ['vue']
        }),
    ],
    // 配置项目别名
    resolve: {
        alias: {
            '@': resolve('src')
        }
    },
    server: {
        hmr: true,
        //vue3 vite配置热更新不用手动刷新
        // Listening on all local IPs
        host: true,
    },
    

})
